/** 
 * 电梯列表
 */
var eleManaged = function() {
	return {
		initData : function(orderId) {
            $.ajax({
                type: "POST",
                url:ctx + "/insureOrderApply/showorderele/"+orderId+"?now=" + new Date().getTime(),
                cache: false,
                contentType: false,
                processData: false,
                success: function(data) {
                    eleManaged.showelevatortable(data);
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    debugger;
                },
            });
		},
		initListener : function() {
		},
        showdialog:function(){
            $("#showeleDetailDlg").modal("show");
        },
        showelevatortable : function(data){
            $("#showeleDetailDlg #InsureOrderListTableDetail tbody").html("");
            $.each(data, function(i, n){
                var html = '<tr role="row" class="odd" id="tr'+n.id+'">' +
                    '<td>'+(i+1)+'</td>'+
                    // ' <td>'+eleManaged.buildnull(n.archiveNo)+'<br/>'+eleManaged.buildnull(n.registerCode)+'<br/>'+eleManaged.buildnull(n.deviceName)+'<br/>'+eleManaged.buildnull(n.deviceType)+'</td>' +
                    // ' <td>'+eleManaged.buildnull(n.useDep)+'<br/>'+eleManaged.buildnull(n.placeType)+'<br/>'+eleManaged.buildnull(n.areaName)
					 //          +'<br/>'+eleManaged.buildnull(n.placeAddress)+'<br/>'+eleManaged.buildnull(n.deviceUseposition)+'</td>' +
                    // ' <td>'+eleManaged.buildnull(n.deviceState)+'<br/>'+eleManaged.buildnull(n.superviceState)+'</td>' +
                    // ' <td>'+n.floorNum+'<br/>'+n.doorNum+'<br/>'+n.stationsNum+'<br/>'+n.speed+'</td>' +
                    // ' <td>'+eleManaged.buildnull(n.makeCompany)+'<br/>'+eleManaged.buildnull(n.installCompany)+'<br/>'+eleManaged.buildnull(n.useDep)+'</td>' +
                    // ' <td>'+eleManaged.fixeddoubletwo(n.totalPremium)+'</td>' +
                    // ' <td>'+eleManaged.buildnull(n.syncDate)+'</td>'+
                    ' <td>'+eleManaged.buildnull(n.registerCode)+'</td>' +
                    ' <td>'+eleManaged.buildnull(n.deviceName)+'</td>' +
                    ' <td>'+eleManaged.buildnull(n.placeType)+'</td>' +
                    ' <td>'+eleManaged.buildnull(n.useDep)+'</td>' +
                    ' <td>'+eleManaged.buildnull(n.deviceUseposition)+'</td>' +
                    ' <td>'+eleManaged.buildnull(n.deviceState)+'</td>' +
                    ' <td>'+eleManaged.fixeddoubletwo(n.totalPremium)+'</td>';
                    ' </tr>'
                $("#showeleDetailDlg #InsureOrderListTableDetail tbody").append(html);
            });
        },
		buildnull:function(value){
        	if(value){
        		return value;
			}else{
        		return "";
			}
		},
        fixeddoubletwo:function(value){
            if(value){
                return parseFloat(value).toFixed(2);
            }else{
                return 0;
            }
        }
	};

}();
$(function(){
    eleManaged.initListener();
});
